<template>
  <view>
    <u-navbar
      :title="type == 1 ? '用户隐私协议' : type == 2 ? '风险通知书' : type == 4 ? '知情同意书' : '用户注册协议'"
      back-icon-size="34"
      title-size="36"
      :border-bottom="false"
      :background="background"
      title-color="#222"
      back-icon-color="#222"
    ></u-navbar>
    <view class="" style="padding: 28rpx">
      <rich-text :nodes="nodes"></rich-text>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      background: {
        background: '#FFFFFF'
      },
      type: null,
      nodes: ''
    };
  },
  methods: {
    about() {
      this.api({
        url: '/api/common/about',
        method: 'post'
      }).then((res) => {
        if (this.type == 1) {
          this.nodes = res.data.privacy.content;
        } else if (this.type == 2) {
          this.nodes = res.data.risk.content;
        } else if (this.type == 4) {
          this.nodes = res.data.Informed.content;
        } else {
          this.nodes = res.data.user.content;
        }
      });
    }
  },
  onLoad(op) {
    this.type = op.type;
    this.about();
  }
};
</script>

<style></style>
